<?php
$account_id = $this->session->userdata('doogy.id');
$account_name = $this->session->userdata('account_name');
echo $erreur;
?>
<div id="wrapper-content" style="width: 90%;">
    <div align="left" id="title_view_profile" >Inbox</div>
    <table align="center" width="100%" class="list" >
        <thead>
            <tr>
                <th colspan="3"></th>
                <th></th>
                <th></th>
            </tr>
        </thead>
        <?php foreach ($messages as $aRow): ?>
            <?php
                $msg_style='';
                if(is_read_message($aRow['id'])){
                    $msg_style=' style="color: blue;font-weight: bolder;" ';
                }else{
                    $msg_style=' style="color: black;" ';
                }
                $image = './doggy_avatar/images/' . $aRow['avatar'];
                if (file_exists($image)) {
                     $image = base_url() . 'doggy_avatar/images/'. $aRow['avatar'];
                } else {
                     $image = root_url('doggy-flirt') . './assets/noimage.gif';
                }

                $long_date = $aRow['posted_date'];
                $now = time();
                $posted_date = timespan($long_date, $now);
            ?>
        <tr class="highlight">
            <td width="10%" valign="top" colspan="2">
                <a style="color: #8099c5" href="<?php echo site_url('message/all_reply') . '/' . $aRow['id']; ?>"><img border="0" src="<?php echo $image;?>" width="60" alt=""/></a>
            </td>
            <td>
                <a <?php echo $msg_style;?> href="<?php echo site_url('message/all_reply') . '/' . $aRow['id']; ?>"><?php echo $aRow['display_name'];?></a>
                <p><a <?php echo $msg_style;?> href="<?php echo site_url('message/all_reply') . '/' . $aRow['id']; ?>"><?php echo $aRow['title']; ?></a></p>
            </td>
            <td align="right">
                <?php echo $posted_date; ?>
            </td>
             <td width="70px">
                <a class="supprimer" href="#" ><img border="0"src="<?php echo root_url('doggy-flirt') . 'assets/admin/' ?>images/supprimer.png"/></a>
                <div style="display:none">
                    Confirmer <br/>
                <a href="<?php echo site_url('message/delete_message') . '/' . $aRow['id'].'/'.$account_id ; ?>"> <img border="0"src="<?php echo root_url('doggy-flirt') . 'assets/admin/' ?>images/oui.png"/></a>
                <a class="non" href="#" ><img  border="0"src="<?php echo root_url('doggy-flirt') . 'assets/admin/' ?>images/non.png"/></a>
                </div>
            </td>
            </tr>
        <?php endforeach; ?>
    </table>
    <?php echo $pagination; ?>
</div>
<!--END wrapper-content-->
